<template>
 

  <!-- 列表 -->
  <ContentWrap>
    <Echart :height="600" :options="lineOptionsData" />
  </ContentWrap>

</template>

<script setup lang="ts">
import { AnalysisApi } from '@/api/crm/crmanalysis'
import { barOptions } from '@/views/Home/echarts-data'
const lineOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption



const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化

const loading = ref(true) // 列表的加载中
const list = ref<CustomerContactsVO[]>([]) // 列表的数据


const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
const activeIndex = ref('my')
const selectCustomers = ref([])
const isDisabled = ref(true)

/** 查询列表 */
const getList = async () => {
  isDisabled.value = true
  loading.value = true
  try {
    const data = await AnalysisApi.getCustomerIndustry()
    lineOptionsData.title.text = '行业分析'
    lineOptionsData.yAxis.data = data.data
    lineOptionsData.series[0].data = data.allCustomer
    lineOptionsData.series[1].data = data.dealCustomer
  } finally {
    loading.value = false
  }
}


/** 搜索按钮操作 */
const handleQuery = () => {
  queryParams.pageNo = 1
  getList()
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields()
  handleQuery()
}

/** 初始化 **/
onMounted(() => {
  getList()
})
</script>